﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="../../Content/Table.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/Material.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="all">

<div id="MaterialOut" class="tableOut">
<table id="MaterialInner" class="tableInner" cellpadding="0" cellspacing="0">
    <tr class="head">
        <td>&nbsp;</td>
        <td>申请类型</td>
        <td>等待处理</td>
        <td>历史</td>
    </tr>
    <tr>
        <td><input name="checkbox" type="checkbox" /></td>
        <td><a href="">公文</a></td>
        <td>2</td>
        <td><a href="">查阅</a></td>
    </tr>
    <tr>
        <td><input name="checkbox" type="checkbox" /></td>
        <td><a href="">会议申请</a></td>
        <td>9</td>
        <td><a href="">查阅</a></td>
    </tr>
    <tr>
        <td><input name="checkbox" type="checkbox" /></td>
        <td><a href="">用车申请</a></td>
        <td>8</td>
        <td><a href="">查阅</a></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>
</div>
<script type="text/javascript">
    var MaterialInner = document.getElementById("MaterialInner");
    var trs = MaterialInner.getElementsByTagName("tr");
    var checkboxes = document.getElementsByName("checkbox");
    
    for (var i = 1; i < trs.length; i++) {
        if (i % 2 != 0) {
            trs[i].className = "a1";
        } else {
            trs[i].className = "a2";
        }
    }


    for (var i = 0; i < checkboxes.length; i++) {
        checkboxes[i].onclick = ChangeChecked;
        /*
        if (checkboxes[i].checked == true) {
            if (i % 2 == 0) {
                trs[i + 1].className = "a3";
            } else {
                trs[i + 1].className = "a4";
            }
        }
        */
    }
    
    function ChangeChecked() {
        for (var i = 0; i < checkboxes.length; i++) {
            if (this == checkboxes[i]) {
                if (checkboxes[i].checked == "") {
                    if (i % 2 == 0) {
                        trs[i + 1].className = "a1";
                    } else {
                        trs[i + 1].className = "a2";
                    }
                } else {
                    if (i % 2 == 0) {
                        trs[i + 1].className = "a3";
                    } else {
                        trs[i + 1].className = "a4";
                    }
                }
            }
        }
    }

</script>




</div>
</body>
</html>
